//
//  TOBaseTableViewCell.m
//  SeaGullFM
//
//  Created by dllo on 15/11/30.
//  Copyright © 2015年 tianou. All rights reserved.
//

#import "WSBaseTableViewCell.h"

@implementation WSBaseTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = COLOR_BTN_DAY;
        self.textLabel.textColor = BLACK;
        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
            self.backgroundColor = COLOR_CELL_NIGHT;
            self.textLabel.textColor = WHITE;
        }
        
    }
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"changeColor" object:nil];
    return self;
}
-(void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"changeColor" object:nil];
}

-(void)changeColor:(NSNotification *)notifition
{
    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"])
    {
        self.backgroundColor = COLOR_CELL_NIGHT;
        self.textLabel.textColor = WHITE;

    }
    else
    {
        self.backgroundColor = COLOR_CELL_DAY;
        self.textLabel.textColor = BLACK;

    }
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
